<script>
import Vue from 'vue';
import { mapActions } from 'vuex'
import { Switch } from 'vant';

Vue.use(Switch);

export default {
  data() {
    return {
      checked: true,
    };
  },
  
  methods: {
    ...mapActions(['showMap'])
  }
}
</script>

<template>
  <div class="switch-btn">
    隐藏地图：
    <van-switch v-model="checked" @change="showMap"/>
  </div>
</template>

<style lang="scss" scoped>
div.switch-btn {
  display: flex;
  justify-content: left;
  align-items: center;
  padding: .2rem;
}
</style>
